import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_jd/pages/feedback/controller.dart';
import 'package:flutter_jd/tools/utils/library.dart';
import 'package:flutter_jd/ui/widgets/body/top_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_state_manager/get_state_manager.dart';

// 功能反馈
class Feedback extends GetView<FeedbackController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: TopBar(
        title: '功能反馈',
        isBack: true,
      ),
      body: GestureDetector(
        onTapDown: (TapDownDetails tapDownDetails) {
          Utils.hideKeyboard(context);
        },
        child: Container(
          color: Colors.transparent,
          height: double.infinity,
          child: Stack(
            children: [
              Container(
                color: Colors.white,
                margin: EdgeInsets.only(top: 1.h),
                padding: EdgeInsets.symmetric(horizontal: 15.w),
                child: TextField(
                  keyboardType: TextInputType.multiline,
                  maxLines: 10,
                  style: TextStyle(
                    color: Colors.black,
                    fontSize: 15.sp,
                  ),
                  textInputAction: TextInputAction.done,
                  decoration: InputDecoration(
                    hintText: '说你想说，畅所欲言的反馈吧～',
                    hintStyle: TextStyle(
                      color: Color(0xFF999999),
                      fontSize: 14.sp,
                    ),
                    border: InputBorder.none, // 去除下边框
                  ),
                ),
              ),
              Positioned(
                bottom: 0,
                left: 0,
                right: 0,
                child: Container(
                  padding: EdgeInsets.only(
                    left: 15.w,
                    right: 15.w,
                    bottom: Utils.getBottomHeight(),
                  ),
                  child: Container(
                    margin: EdgeInsets.only(top: 50.h),
                    child: Ink(
                      decoration: BoxDecoration(
                        gradient: LinearGradient(
                          begin: Alignment.topLeft,
                          end: Alignment.bottomRight,
                          colors: [
                            Color(0xFFFA2F19),
                            Color(0xFFFA722E),
                          ],
                        ),
                        borderRadius: BorderRadius.circular(30.r),
                      ),
                      child: InkWell(
                        borderRadius: BorderRadius.circular(30.r),
                        splashColor: Color(0xFFFA2F19),
                        onTap: () {
                          controller.submit();
                        },
                        child: Container(
                          width: 300.w,
                          height: 45.h,
                          alignment: Alignment.center,
                          child: Text(
                            '提交',
                            style: TextStyle(
                              color: Colors.white,
                              fontSize: 14.sp,
                            ),
                          ),
                        ),
                      ),
                    ),
                  ),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
